<template>
  <div class="dashboard-editor-container">
    <panel-group />
    <el-tabs type="border-card" class="chartTab">
      <el-tab-pane label="用户统计" name=""><line-chart :chart-data="lineChartData.people"/></el-tab-pane>
      <el-tab-pane label="请假统计"><line-chart :chart-data="lineChartData.leaves"/></el-tab-pane>
      <el-tab-pane label="作业统计"><line-chart :chart-data="lineChartData.works"/></el-tab-pane>
      <el-tab-pane label="图书统计"><line-chart :chart-data="lineChartData.books"/></el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import LineChart from './components/LineChart'
import PanelGroup from './components/PanelGroup'
export default {
  name: 'DashboardAdmin',
  components: {
    PanelGroup,
    LineChart
  },
  data() {
    return {
      lineChartData: {
        people: {
          title: '成员数量',
          actualData: [120, 82, 91, 154, 162, 140, 145]
        },
        leaves: {
          title: '请假次数',
          actualData: [180, 160, 151, 106, 145, 150, 130]
        },
        works: {
          title: '作业提交',
          actualData: [120, 90, 100, 138, 142, 130, 130]
        },
        books: {
          title: '图书数',
          actualData: [120, 82, 91, 154, 162, 140, 130]
        }
      }
    }
  },
  methods: {
  }
}
</script>

<style lang="scss" scoped>
.dashboard-editor-container {
  padding: 32px;
  background-color: rgb(240, 242, 245);
  position: relative;

  .github-corner {
    position: absolute;
    top: 0px;
    border: 0;
    right: 0;
  }

  .chart-wrapper {
    background: #fff;
    padding: 16px 16px 0;
    margin-bottom: 32px;
  }
}

@media (max-width:1024px) {
  .chart-wrapper {
    padding: 8px;
  }
}

.chartTab >{
  width: 100%;
}
</style>
